package com.cn.ycy.beanreference;

import com.cn.ycy.CompentScanConfig;
import com.cn.ycy.transaction.JdbcTempleteServiceImpl;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;


public class TransactionTest {

    A bean;

    @Before
    public void Before() {
        AnnotationConfigApplicationContext annotationConfigApplicationContext =
                new AnnotationConfigApplicationContext(CompentScanConfig.class);
        // 演示事务的传播性质
        bean = annotationConfigApplicationContext.getBean(A.class);
    }

    @Test
    public void test1() {
        bean.test1();
    }

    /**
     * 复现空针异常
     */
    @Test
    public void test2() {
        bean.test2();
    }


}
